package com.yuqq.token.controller;

import com.yuqq.token.domain.ResponseResult;
import com.yuqq.token.domain.User;
import com.yuqq.token.service.LoginUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class LoginController {

    @Autowired
    private LoginUserService loginUserService;

    @PostMapping("/user/login")
    public ResponseResult login(@RequestBody User user){
        return loginUserService.login(user);
    }

    @RequestMapping("/user/logout")
    public ResponseResult logout(){
        return loginUserService.logout();
    }
}
